home *** CD-ROM | disk | FTP | other *** search
/ Ray Dream Studio 5 / Ray Dream.iso / pc / DreamSDK / Windows / SAMPLES / LIGHT / LITE / COMLITE.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-07-11  |  3.6 KB  |  85 lines

  1. // Copyright (c)1995 Ray Dream, Inc. All Rights Reserved.
  2. /* $Id: COMLite.h 1.2 1996/09/27 21:06:18 DAMIEN Exp $ */
  3.  
  4. ////////////////////////////////////////////////////////////////////////
  5. //   First Light Source Example : Beams Light                         //
  6. //--------------------------------------------------------------------//
  7. //   Declaration of the Beams Light Interface                         //
  8. //////////////////////////////////////////////////////////////////////// 
  9.  
  10.  
  11. #ifndef __COMLITE__
  12. #define __COMLITE__
  13.  
  14. #ifndef __I3DEXLIT__
  15. #include "I3DExLit.h"
  16. #endif
  17.                   
  18. // CLSID of Beams Light 
  19. // to put in the Registration Database \CLSID\{...} = RDD COM BeamsLight
  20. //                                            InprocServer = fullpathname to RDX file  
  21. // F3472360-734D-101C-B801-04021C007002
  22. DEFINE_GUID(CLSID_BeamsLight, 0xF3472360L, 0x734D, 0x101C, 0xB8, 0x01, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02);
  23.                             
  24.  
  25. // Light Data structure                            
  26. typedef struct LightData {
  27.   short   fHorApertureAngle;    // Angular Limits of the light source
  28.   short   fVerApertureAngle;    //
  29.   NUM3D   fIntensity;           // Light source intensity 
  30.   short   fNbBeamsHorizontally; // Number of Beams Horizontally and Vertically
  31.   short   fNbBeamsVertically;   //
  32.   COLOR3D fLightColor;          // Default color
  33.   short   fBeamAperture;        // Angular Limit of the singular Beam
  34.   } LightData;
  35.  
  36.  
  37. // Beams Light Object :
  38. #undef INTERFACE
  39. #define INTERFACE BeamsLight
  40. class BeamsLight : public I3DExLightsource {
  41. public :  
  42.   BeamsLight();
  43.   ~BeamsLight();
  44.   
  45.   // IUnknown Interface :
  46.   STDMETHODIMP         QueryInterface(THIS_ REFIID riid, LPVOID* ppvObj);
  47.   STDMETHODIMP_(ULONG) AddRef(THIS);
  48.   STDMETHODIMP_(ULONG) Release(THIS);
  49.   
  50.   // I3DExtension method :
  51.   STDMETHODIMP_(I3DExtension*) Clone(THIS);
  52.   STDMETHODIMP                 ShellUtilitiesInit(THIS_ IShUtilities* shellUtilities);
  53.     
  54.   // I3DExDataExchanger methods :
  55.   STDMETHODIMP_(ExtensionDataMap*) GetExtensionDataMap(THIS);
  56.   STDMETHODIMP_(void*)            GetExtensionDataBuffer(THIS);
  57.   STDMETHODIMP                     ExtensionDataChanged(THIS);
  58.   STDMETHODIMP                     HandleEvent(THIS_ ULONG sourceID);
  59.   STDMETHODIMP_(short)            GetResID(THIS);
  60.   
  61.   // I3DExLightsource methods
  62.   STDMETHODIMP           SetTransform(THIS_ TRANSFORM3D* transform);
  63.   STDMETHODIMP           GetDirection(THIS_ VECTOR3D* position, VECTOR3D* resultDirection, NUM3D* resultDistance);
  64.   STDMETHODIMP_(BOOLEAN) GetColor(THIS_ VECTOR3D* position, VECTOR3D* direction, NUM3D distance, COLOR3D* result, BOOLEAN* CallForShadowEffect);
  65.   STDMETHODIMP_(BOOLEAN) IsVisibleInPerspective(THIS);
  66.   STDMETHODIMP           ShadowEffect(THIS_ NUM3D distance, COLOR3D* result);
  67.     STDMETHODIMP_(LightTraceElement*) GetNewTrace(THIS_ short* nb);
  68.     STDMETHODIMP_(ULONG)     GetPrimitiveID(THIS);
  69.     STDMETHODIMP                     ForEachShadowBuffer(THIS_ ForEachShadowBufferCallback proc, void* priv);
  70.     STDMETHODIMP                     GetLightParameter(THIS_ long keyword, void* parameter);
  71.    
  72. private :
  73.   TRANSFORM3D  fTransform;      // Transformation Data (Local to Global and Global to Local)
  74.   ULONG        fCRef;           // reference Counter
  75.   LightData    fData;           // Light Data (see definition of LightData structure)
  76.   NUM3D        fHorAng,fVerAng; // NUM3D Value of the angle data.
  77.   NUM3D        fBeamLimit;      // Limit of the single beam (cosinus)
  78.   NUM3D        fBeamAngle;      //  and in degree 
  79.   };
  80.                           
  81.  
  82.  
  83. #endif // __BEAMLGHT__
  84.  
  85.